<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no" />
    <meta name="theme-color" content="#000000" />
    <title>Soico</title>
    <link rel="stylesheet" href="../../css/main.827f7436.css" />
    <link rel="stylesheet" href="../../css/materialize.min.css" />
    <link rel="stylesheet" href="../../css/App.css" />
    <link rel="stylesheet" href="../../css/Header.css" />
    <script type="text/javascript" async="" src="../../js/common/recaptcha__zh_cn.js"></script>
    <script type="text/javascript" src="../../js/common/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="../../js/common/materialize.min.js"></script>
    <script type="text/javascript" src="../../js/common/public.js"></script>
</head>
<body>
<div id="root">
    <div style="background-color: rgb(250, 250, 250); min-height: 100vh; min-width: 1000px; font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;">
        <div>
            <div class="s-alert-wrapper"></div>
            <%@include file="top.jsp"%>
            <div class="container">
                <div>
                    <p id="userName">您的Soico钱包:jshao</p>
                    <div class="col s12" style="margin-top: 30px;">
                        <div class="row">
                            <div class="col s1.3">
                                <a id="personalPage" class="textcenter headerItem personalPage" href="profileSkip?pk=${user}&time=${time}&auth=${auth}">总览</a>
                            </div>
                            <div class="col s1.3">
                                <a class="textcenter headerItem " href="deposeSkip?pk=${user}&time=${time}&auth=${auth}">充值</a>
                            </div>
                            <div class="col s1.3">
                                <a class="textcenter headerItem " href="withdrawsSkip?pk=${user}&time=${time}&auth=${auth}">提现</a>
                            </div>
                            <div class="col s1.3">
                                <a class="textcenter headerItem " href="ordersSkip?pk=${user}&time=${time}&auth=${auth}">投资纪录</a>
                            </div>
                            <div class="col s1.3">
                                <a class="textcenter headerItem " href="transactionsSkip?pk=${user}&time=${time}&auth=${auth}">ETH交易纪录</a>
                            </div>
                            <!--<div class="col s1.3">
                                <a class="textcenter headerItem " href="transactions_token.jsp">Token交易纪录</a>
                            </div>-->
                            <div class="col s1.3">
                                <a class="textcenter headerItem active" href="setting.jsp">设置</a>
                            </div>
                            <!--<div class="col s1.3">
                                <a class="textcenter headerItem promo " href="referral.jsp">免手续费</a>
                            </div>-->
                            <div class="col s1.3">
                                <a class="textcenter headerItem " href="supportSkip?pk=${user}&time=${time}&auth=${auth}">联系客服</a>
                            </div>
                            <!--<div class="col s1.3">
                                <a class="textcenter headerItem " href="VIP.jsp">VIP</a>
                            </div>-->
                        </div>
                    </div>
                    <div class="row commonMarginTop">
                        <div class="loadingContainer hidden">
                            <div class="loadIndicator preloader-wrapper active">
                                <div class="spinner-layer spinner-blue">
                                    <div class="circle-clipper left">
                                        <div class="circle"></div>
                                    </div>
                                    <div class="gap-patch">
                                        <div class="circle"></div>
                                    </div>
                                    <div class="circle-clipper right">
                                        <div class="circle"></div>
                                    </div>
                                </div>
                                <div class="spinner-layer spinner-red">
                                    <div class="circle-clipper left">
                                        <div class="circle"></div>
                                    </div>
                                    <div class="gap-patch">
                                        <div class="circle"></div>
                                    </div>
                                    <div class="circle-clipper right">
                                        <div class="circle"></div>
                                    </div>
                                </div>
                                <div class="spinner-layer spinner-yellow">
                                    <div class="circle-clipper left">
                                        <div class="circle"></div>
                                    </div>
                                    <div class="gap-patch">
                                        <div class="circle"></div>
                                    </div>
                                    <div class="circle-clipper right">
                                        <div class="circle"></div>
                                    </div>
                                </div>
                                <div class="spinner-layer spinner-green">
                                    <div class="circle-clipper left">
                                        <div class="circle"></div>
                                    </div>
                                    <div class="gap-patch">
                                        <div class="circle"></div>
                                    </div>
                                    <div class="circle-clipper right">
                                        <div class="circle"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col s10 offset-s1 cardContainer">
                            <div style="margin-top: 20px;">
                                <div class="row">
                                    <div class="col s2">
                                        <a class="textcenter tabItem active" href="/profile/setting/detail">基本资料</a>
                                    </div>
                                    <div class="col s2">
                                        <a class="textcenter tabItem " href="/profile/setting/password">更改密码</a>
                                    </div>
                                </div>
                            </div>
                            <div style="height: 1px; background-color: rgb(186, 184, 184); margin: 10px 0px;"></div>
                            <form id="setting">
                                <div class="row">
                                    <div class="input-field col s12">
                                        <div>
                                            <label></label>
                                            <div>
                                                <input type="text" id="displayName" class="displayName" name="displayName" value="" />
                                                <label class="" for="displayName">用户名称</label>
                                                <span class="red-text hide">请输入正确用户名称</span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="input-field col s12">
                                        <div>
                                            <label></label>
                                            <div>
                                                <input type="text" id="telegramId" class="telegramId" name="telegramId" value="" />
                                                <label class="" for="telegramId">Telegram ID</label>
                                                <span class="red-text hide">请输入正确Telegram ID</span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="input-field col s12">
                                        <div>
                                            <label></label>
                                            <div>
                                                <input type="text" id="wechatId" class="wechatId" name="wechatId" value="" />
                                                <label class="" for="wechatId">微信(Wechat) ID</label>
                                                <span class="red-text hide">请输入正确微信 ID</span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="input-field col s12">
                                        <div>
                                            <div>
                                                <div class="react-datepicker-wrapper">
                                                    <div class="react-datepicker__input-container">
                                                        <input type="text" id="birthday" class="birthday" value="" name="birthday" class="" />
                                                        <span class="red-text hide">请输入正确微信 ID</span>
                                                    </div>
                                                </div>
                                            </div>
                                            <label class="" for="birthday">生日</label>
                                        </div>
                                    </div>
                                </div>
                                <button id="submit" class="btn waves-effect waves-light signInBtn col s6 offset-s3">更新</button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <footer class="page-footer">
                <%@include file="footer.jsp"%>
            </footer>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    $(function(){

        $("#setting input").on("blur",function(){
            var obj = $(this);
            var vals = $(this).val();
            if(vals==''){
                if($(obj).hasClass("birthday")){
                    obj.parent().parent().parent().siblings("label").removeClass("active")
                }
                obj.siblings("label").removeClass("active")
            }
            checkForm(obj);
        });
        $("#setting input").on("focus",function(){
            var obj = $(this);
            if($(this).hasClass("birthday")){
                obj.parent().parent().parent().siblings("label").addClass("active")
            }
            obj.siblings("label").addClass("active")
        });

        function checkForm(obj){ // #tbInfoBox

            if($(obj).hasClass("email")){
                var email=(obj).val().trim();
                if(!isEmail(email)){
                    $(obj).siblings(".red-text").removeClass("hide");
                    return false;
                }else{
                    $(obj).siblings(".red-text").addClass("hide");
                }
            }

            if($(obj).hasClass("displayName")){
                var name=(obj).val().trim();
                if(!isUserName(name)){
                    $(obj).siblings(".red-text").removeClass("hide");
                    return false;
                }else{
                    $(obj).siblings(".red-text").addClass("hide");
                }
            }

            if($(obj).hasClass("telegramId")){
                var telegramId=(obj).val();
                if(telegramId==''){
                    $(obj).siblings(".red-text").removeClass("hide");
                    return false;
                }else{
                    $(obj).siblings(".red-text").addClass("hide");
                }
            }

            if($(obj).hasClass("wechatId")){
                var wechatId=(obj).val();
                if(wechatId==''){
                    $(obj).siblings(".red-text").removeClass("hide");
                    return false;
                }else{
                    $(obj).siblings(".red-text").addClass("hide");
                }
            }

            if($(obj).hasClass("birthday")){
                var birthday=(obj).val();
                if(birthday == ''){
                    $(obj).siblings(".red-text").removeClass("hide");
                    return false;
                }else{
                    $(obj).siblings(".red-text").addClass("hide");
                }
            }

            return true;
        }

        $("#submit").click(function(){
            var objArray = $("#setting input");
            var objArrayLen = objArray.length;
            for(var i = 0; i < objArrayLen; i++){
                flagForm = checkForm($(objArray[i]));
                if(!flagForm){
                    return false;
                }
            }
            $("#setting").submit();
        })
    })
</script>
</html>